# Copyright 2019 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

# NOTE: This file is auto generated by the elixir code generator program.
# Do not edit this file manually.

defmodule GoogleApi.CloudSearch.V1.Model.FacetResult do
  @moduledoc """
  Source specific facet response

  ## Attributes

  *   `buckets` (*type:* `list(GoogleApi.CloudSearch.V1.Model.FacetBucket.t)`, *default:* `nil`) - FacetBuckets for values in response containing at least a single result with the corresponding filter.
  *   `objectType` (*type:* `String.t`, *default:* `nil`) - Object type for which facet results are returned. Can be empty.
  *   `operatorName` (*type:* `String.t`, *default:* `nil`) - The name of the operator chosen for faceting. @see cloudsearch.SchemaPropertyOptions
  *   `sourceName` (*type:* `String.t`, *default:* `nil`) - Source name for which facet results are returned. Will not be empty.
  """

  use GoogleApi.Gax.ModelBase

  @type t :: %__MODULE__{
          :buckets => list(GoogleApi.CloudSearch.V1.Model.FacetBucket.t()) | nil,
          :objectType => String.t() | nil,
          :operatorName => String.t() | nil,
          :sourceName => String.t() | nil
        }

  field(:buckets, as: GoogleApi.CloudSearch.V1.Model.FacetBucket, type: :list)
  field(:objectType)
  field(:operatorName)
  field(:sourceName)
end

defimpl Poison.Decoder, for: GoogleApi.CloudSearch.V1.Model.FacetResult do
  def decode(value, options) do
    GoogleApi.CloudSearch.V1.Model.FacetResult.decode(value, options)
  end
end

defimpl Poison.Encoder, for: GoogleApi.CloudSearch.V1.Model.FacetResult do
  def encode(value, options) do
    GoogleApi.Gax.ModelBase.encode(value, options)
  end
end
